import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

class Webview extends StatelessWidget {

  final String url;
  final String title;
  Webview({this.title, this.url});

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar:AppBar(title: Text(title ?? "网页"),),
      body: WebView(
        initialUrl: url ?? "https://www.jianshu.com/p/de7703c8d746",
        onPageFinished: (str){
          print(str);
        },
      ),
    );
  }

}